import { Ref } from "vue";

export default function OperationHook(state: { emit: any; dialogOpts: Base.DialogOpts; passData: Ref<ReceivableFee.ListRows[]>; loading: Ref<boolean> }) {
  const { passData, dialogOpts, emit } = state;
  // 生成对账单
  const createBillHandle = () => {
    dialogOpts.title = `生成对账单`;
    dialogOpts.width = "520px";
    dialogOpts.type = 2;
    dialogOpts.component = "CreateBill";
    dialogOpts.passData = passData.value;
    dialogOpts.visible = true;
  };
  const dialogSubmitHandle = () => {
    dialogOpts.visible = false;
    emit("submit");
  };
  return {
    createBillHandle,
    dialogSubmitHandle
  };
}
